import { saveOrderModuleFinishTemplate } from '@/api/basic'
import { ref } from 'vue'

// 加载
const loading = ref(false)

/**
 * 保存方法
 * @param {string} id - 工单模块id
 * @param {Array<string>} templateIds - 模版id集合
 */
const saveFn = async (id: any, templateIds: Array<string>) => {
  loading.value = true
  const res = await saveOrderModuleFinishTemplate(id, templateIds)
  loading.value = false
  return res.data as { code: number; data: object; message: string; success: boolean }
}

export default {
  loading,
  saveFn,
}
